package cn.quevo.cube.provide.data.service.impl;

import cn.quevo.common.entity.PageResult;
import cn.quevo.cube.provide.data.dao.CubeModelDataDao;
import cn.quevo.cube.provide.data.entity.CubeModelData;
import cn.quevo.cube.provide.data.entity.query.CubeModelDataQuery;
import cn.quevo.cube.provide.data.service.CubeModelDataService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 数据记录表 Service接口实现
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2018/12/11 14:57:51
 * @Copyright 东方浩星（北京）传媒科技有限公司版权所有.All Rights Reserved.
 */
@Service("cubeModelDataService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class CubeModelDataServiceImpl implements CubeModelDataService {
    @Resource(name="cubeModelDataDao")
    private CubeModelDataDao cubeModelDataDao;

    @Override
    public Map<String,Object> getSinge(CubeModelDataQuery cubeModelDataQuery) {
        return this.cubeModelDataDao.getSinge(cubeModelDataQuery);
    }

    @Override
    public Integer create(CubeModelData cubeModelData) {
        cubeModelData.validateCreate();
        return this.cubeModelDataDao.create(cubeModelData);
    }

    @Override
    public Integer update(CubeModelData cubeModelData) {
        cubeModelData.validateUpdate();
        return this.cubeModelDataDao.update(cubeModelData);
    }

    @Override
    public PageResult<Map<String,Object>> getPage(CubeModelDataQuery cubeModelDataQuery) {
        return this.cubeModelDataDao.getPage(cubeModelDataQuery);
    }
}
